package io.spring.sample.graphql.repository.base;

import io.spring.sample.graphql.jpa.ProjectionRepository;
import io.spring.sample.graphql.jpa.QuerydslNcExecutor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.graphql.data.GraphQlRepository;

import java.util.List;
import java.util.UUID;

@GraphQlRepository
public interface Persons extends ProjectionRepository<Person, UUID>, QuerydslNcExecutor<Person>, JpaRepository<Person, UUID> {
    //Person findByName(String name);  //非唯一性的 报错
    Person findByNo(String no);
    Person findByNameAndNo(String name,String no);  //确保最多只有一条
    Person findTopByNo(String no);
    List<Person>  findAllByNameLike(String namepair);
}

